package com.wlyuan.open.translator;

import com.wlyuan.basic.dto.consignee.ReceivingAddressDetailDTO;
import com.wlyuan.basic.dto.customer.ShippingAddressDetailDTO;
import com.wlyuan.open.basic.vo.OpenReceivingAddressDetailVO;
import com.wlyuan.open.basic.vo.OpenShippingAddressDetailVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * @author
 * 地址 OpenDTO -> 业务DTO
 */
public class AddressTranslator {
    @Mapper(
            uses = {},
            imports = {}
    )
    public interface Translator {

        OpenShippingAddressDetailVO translate(ShippingAddressDetailDTO source);

        OpenReceivingAddressDetailVO translate(ReceivingAddressDetailDTO source);
    }

    private static final Translator TRANSLATOR = Mappers.getMapper(Translator.class);

    public static OpenShippingAddressDetailVO translate(ShippingAddressDetailDTO source){
        return TRANSLATOR.translate(source);
    }

    public static OpenReceivingAddressDetailVO translate(ReceivingAddressDetailDTO source){
        return TRANSLATOR.translate(source);
    }
}
